package com.platform.api.dao;

import com.platform.api.entity.SmsLogVo;
import com.platform.api.entity.UserVo;
import com.platform.common.dao.BaseDao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 用户
 *
 * @author lipengjun
 * @email 939961241@qq.com
 * @gitee https://gitee.com/fuyang_lipengjun/platform
 * @date 2017-03-23 15:22:06
 */
@Mapper
@Repository
public interface ApiUserMapper{// } extends BaseDao<UserVo> {
    int save(UserVo t);
    void save(Map<String, Object> map);
    void saveBatch(List<UserVo> list);
    int update(UserVo t);
    int update(Map<String, Object> map);
    int delete(Object id);
    int delete(Map<String, Object> map);
    int deleteBatch(Object[] id);
    UserVo queryObject(Object id);
    List<UserVo> queryList(Map<String, Object> map);
    List<UserVo> queryList(Object id);
    int queryTotal(Map<String, Object> map);
    int queryTotal();
    UserVo queryByMobile(String mobile);

    UserVo queryByOpenId(@Param("openId") String openId);

    /**
     * 获取用户最后一条短信
     *
     * @param user_id
     * @return
     */
    SmsLogVo querySmsCodeByUserId(@Param("user_id") Long user_id);

    /**
     * 保存短信
     *
     * @param smsLogVo
     * @return
     */
    int saveSmsCodeLog(SmsLogVo smsLogVo);
}
